{{include file="public/header" /}}

<!-- nav start -->
{{include file="public/nav" /}}
<!-- nav end -->

<!-- header top nav -->
{{include file="public/header_top_nav" /}}

<!-- search -->
{{include file="public/nav_search" /}}

<!-- header nav -->
{{include file="public/header_nav" /}}

<!-- goods category -->
{{include file="public/goods_category" /}}

<!-- banner -->
{{include file="public/home_banner" /}}

<!-- 轮播上内容 -->
<div class="am-container slideall">
    <!-- 轮播-手机导航 -->
    {{include file="public/home_nav" /}}

    <!-- 轮播-聚合内容 -->
    {{if MyC('home_index_banner_right_status', 1) eq 1}}
        <div class="banner-mixed">
            <div class="mod-vip">
                <div class="m-baseinfo">
                    <a {{if !empty($user)}}href="{{:MyUrl('index/user/index')}}" target="_blank"{{else /}}href="javascript:;"{{/if}}>
                        <img src="{{if !empty($user['avatar'])}}{{$user.avatar}}{{else /}}{{$attachment_host}}/static/{{$module_name}}/{{$default_theme}}/images/default-user-avatar.jpg{{/if}}" class="user-avatar" />
                    </a>
                    <em>
                        <span class="s-name am-text-truncate">
                            {{if !empty($user)}}
                                <em>Hi,</em>
                                {{if !empty($user['icon'])}}
                                    <img src="{{$user.icon}}" class="common-user-icon" {{if !empty($user['icon_title'])}}title="{{$user.icon_title}}"{{/if}} />
                                {{/if}}
                                <em>{{$user.user_name_view}}</em>
                            {{else /}}
                                <em>您好，欢迎来到</em>
                                <em>{{:MyC('home_site_name')}}</em>
                            {{/if}}
                        </span>
                    </em>
                    {{if !empty($user)}}
                        <a href="{{:MyUrl('index/user/logout')}}" class="member-logout">退出</a>
                    {{/if}}
                </div>
                {{if empty($user) and (!empty($home_user_login_type) or !empty($home_user_reg_type))}}
                    <div class="member-login">
                        {{if !empty($home_user_login_type)}}
                            <a class="am-btn-primary btn am-fl" href="{{:MyUrl('index/user/loginInfo')}}">登录</a>
                        {{/if}}
                        {{if !empty($home_user_reg_type)}}
                            <a class="am-btn-primary btn am-fr" href="{{:MyUrl('index/user/regInfo')}}">注册</a>
                        {{/if}}
                    </div>
                {{/if}}
                {{if !empty($user)}}
                    <div class="member-center">
                        {{if !empty($user_order_status)}}
                            {{foreach $user_order_status as $v}}
                                {{if in_array($v['status'], [1,2,3])}}
                                    <a href="{{:MyUrl('index/order/index', ['is_more'=>1, 'status'=>$v['status']])}}" target="_blank"><strong>{{$v.count}}</strong>{{$v.name}}</a>
                                {{elseif in_array($v['status'], [100]) /}}
                                    <a href="{{:MyUrl('index/order/index', ['is_more'=>1, 'is_comments'=>0, 'status'=>4])}}" target="_blank"><strong>{{$v.count}}</strong>{{$v.name}}</a>
                                {{/if}}
                            {{/foreach}}
                        {{/if}}
                    </div>
                {{/if}}
            </div>
            {{if !empty($article_list)}}
                <div class="banner-news">
                    <p class="banner-news-title am-text-truncate">新闻头条</p>
                    <ul>
                        {{foreach $article_list as $article}}
                            <li class="am-text-truncate">
                                {{if isset($article['article_category_name']) and isset($article['category_url'])}}
                                    <span>[</span><a href="{{$article.category_url}}" target="_blank"><p class="news-category-name am-inline-block am-text-truncate">{{$article.article_category_name}}</p></a><span>]</span>
                                {{/if}}
                                <a href="{{$article.url}}" target="_blank" {{if !empty($article.title_color)}}style="color:{{$article.title_color}};"{{/if}}>{{$article.title}}</a>
                            </li>
                        {{/foreach}}
                    </ul>
                </div>
            {{/if}}

            <!-- 轮播混合数据底部钩子 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_home_banner_mixed_bottom</span>
                </div>
            {{/if}}
            {{if !empty($plugins_view_home_banner_mixed_bottom_data) and is_array($plugins_view_home_banner_mixed_bottom_data)}}
                {{foreach $plugins_view_home_banner_mixed_bottom_data as $hook}}
                    {{if is_string($hook) or is_int($hook)}}
                        {{$hook|raw}}
                    {{/if}}
                {{/foreach}}
            {{/if}}
        </div>
    {{/if}}
</div>

<!-- 楼层数据顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    <div class="plugins-tag">
        <span>plugins_view_home_floor_top</span>
    </div>
{{/if}}
{{if !empty($plugins_view_home_floor_top_data) and is_array($plugins_view_home_floor_top_data)}}
    {{foreach $plugins_view_home_floor_top_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
        {{/if}}
    {{/foreach}}
{{/if}}

<!-- 楼层-主内容 -->
{{if isset($floor_data_type) and $floor_data_type eq 2}}
    <!-- 是否设计模式 -->
    <div class="am-container">
        {{if isset($is_design) and $is_design eq 1}}
            <div class="am-margin-top-sm">
                <div class="layout-operate-container am-fr" data-save-url="{{$layout_save_url}}">
                    <a href="{{$Think.__MY_URL__}}" class="am-btn am-btn-warning am-btn-xs am-radius">取消</a>
                    <button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-margin-left-sm" data-am-loading="{loadingText:'处理中...'}">保存</button>
                </div>
                {{include file="../../../layout/view/base" /}}
            </div>
        {{else /}}
            {{include file="../../../layout/view/view" /}}
        {{/if}}
    </div>
{{else /}}
    <div class="home-floor">
        <!-- 楼层 -->
        {{if !empty($goods_floor_list) and is_array($goods_floor_list)}}
            {{foreach $goods_floor_list as $key=>$floor}}
                <!-- 首页楼层顶部钩子 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_home_floor_top_{{$key+1}}</span>
                    </div>
                {{/if}}
                {{php}}
                    $hook_name = 'plugins_view_home_floor_top_'.($key+1);
                    $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                    if(!empty($hook_data) && is_array($hook_data))
                    {
                        foreach($hook_data as $hook)
                        {
                            if(is_string($hook) || is_int($hook))
                            {
                                echo htmlspecialchars_decode($hook);
                            }
                        }
                    }
                {{/php}}

                <!-- 楼层数据 -->
                <div id="floor{{$key+1}}">
                    <div class="am-container">
                        <div class="items-nav-title" {{if !empty($floor['bg_color'])}}style="border-bottom: 2px solid {{$floor.bg_color}};"{{/if}}>
                            <p class="floor-title">{{$floor.name}}</p>
                            <p class="floor-desc">{{$floor.vice_name}}</p>
                            <div class="today-brands ">
                                {{if !empty($floor['config_keywords']) and is_array($floor['config_keywords'])}}
                                    {{foreach $floor.config_keywords as $wd}}
                                        <a href="{{:MyUrl('index/search/index', ['wd'=>StrToAscii($wd)])}}" target="_blank">{{$wd}}</a>
                                    {{/foreach}}
                                {{/if}}
                            </div>
                            <span class="more">
                                <a href="{{:MyUrl('index/search/index', ['category_id'=>$floor['id']])}}" target="_blank">更多 <i class="am-icon-angle-right"></i></a>
                            </span>
                        </div>
                    </div>
                    
                    <div class="am-g am-g-fixed floor">
                        <!-- 首页楼层内部顶部钩子 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                            <div class="plugins-tag">
                                <span>plugins_view_home_floor_inside_top</span>
                            </div>
                        {{/if}}
                        {{php}}
                            $hook_name = 'plugins_view_home_floor_inside_top';
                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                            if(!empty($hook_data) && is_array($hook_data))
                            {
                                foreach($hook_data as $hook)
                                {
                                    if(is_string($hook) || is_int($hook))
                                    {
                                        echo htmlspecialchars_decode($hook);
                                    }
                                }
                            }
                        {{/php}}

                        <div class="am-u-sm-3 aggregation" {{if !empty($floor['bg_color'])}}style="background-color:{{$floor.bg_color}};"{{else /}}style="background-color:#eaeaea;"{{/if}}>
                            <div class="word">
                                {{if !empty($floor['items']) and is_array($floor['items'])}}
                                    {{foreach $floor.items as $category_key=>$category}}
                                        <a href="{{:MyUrl('index/search/index', ['category_id'=>$category['id']])}}" class="outer" target="_blank">{{:mb_substr($category['name'], 0, 4, 'utf-8')}}</a>
                                    {{/foreach}}
                                {{/if}}           
                            </div>
                            <div class="outer-con">
                                <div class="describe">{{$floor.describe}}</div>
                            </div>
                            {{if !empty($floor['big_images'])}}
                                <a href="{{:MyUrl('index/search/index', ['category_id'=>$floor['id']])}}" target="_blank">
                                    <img src="{{$floor.big_images}}" />
                                </a>
                            {{/if}}
                            <div class="triangle-topright"></div>

                            <!-- 首页楼层内部底部钩子 -->
                            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                <div class="plugins-tag">
                                    <span>plugins_view_home_aggregation_inside_bottom</span>
                                </div>
                            {{/if}}
                            {{php}}
                                $hook_name = 'plugins_view_home_aggregation_inside_bottom';
                                $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                                if(!empty($hook_data) && is_array($hook_data))
                                {
                                    foreach($hook_data as $hook)
                                    {
                                        if(is_string($hook) || is_int($hook))
                                        {
                                            echo htmlspecialchars_decode($hook);
                                        }
                                    }
                                }
                            {{/php}}
                        </div>

                        <div class="goods-list">
                            {{if !empty($floor['goods']) and is_array($floor['goods'])}}
                                {{foreach $floor.goods as $goods_key=>$goods}}
                                    <div class="goods-items">
                                        <a href="{{$goods.goods_url}}" target="_blank" class="am-block am-text-center">
                                            <!-- 首页楼层商品内部顶部钩子 -->
                                            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                <div class="plugins-tag">
                                                    <span>plugins_view_home_goods_inside_top</span>
                                                </div>
                                            {{/if}}
                                            {{php}}
                                                $hook_name = 'plugins_view_home_goods_inside_top';
                                                $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'goods_id'=>$goods['id'], 'goods'=>$goods]);
                                                if(!empty($hook_data) && is_array($hook_data))
                                                {
                                                    foreach($hook_data as $hook)
                                                    {
                                                        if(is_string($hook) || is_int($hook))
                                                        {
                                                            echo htmlspecialchars_decode($hook);
                                                        }
                                                    }
                                                }
                                            {{/php}}
                                            <img src="{{$goods.images}}" alt="{{$goods.title}}" class="goods-images" />
                                        </a>
                                        <div class="outer-con">
                                            <div class="goods-title am-text-truncate-2 am-margin-bottom-xs">
                                                <a href="{{$goods['goods_url']}}" target="_blank" {{if !empty($goods.title_color)}}style="color:{{$goods.title_color}};"{{/if}}>{{$goods.title}}</a>
                                            </div>

                                            <!-- 首页楼层商品售价顶部钩子 -->
                                            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                <div class="plugins-tag">
                                                    <span>plugins_view_home_goods_inside_price_top</span>
                                                </div>
                                            {{/if}}
                                            {{php}}
                                                $hook_name = 'plugins_view_home_goods_inside_price_top';
                                                $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'goods_id'=>$goods['id'], 'goods'=>$goods]);
                                                if(!empty($hook_data) && is_array($hook_data))
                                                {
                                                    foreach($hook_data as $hook)
                                                    {
                                                        if(is_string($hook) || is_int($hook))
                                                        {
                                                            echo htmlspecialchars_decode($hook);
                                                        }
                                                    }
                                                }
                                            {{/php}}
                                            <p class="price am-text-truncate">{{$currency_symbol}}{{$goods.price}}</p>
                                        </div>

                                        <!-- 首页楼层商品内部底部钩子 -->
                                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                            <div class="plugins-tag">
                                                <span>plugins_view_home_goods_inside_bottom</span>
                                            </div>
                                        {{/if}}
                                        {{php}}
                                            $hook_name = 'plugins_view_home_goods_inside_bottom';
                                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'goods_id'=>$goods['id'], 'goods'=>$goods]);
                                            if(!empty($hook_data) && is_array($hook_data))
                                            {
                                                foreach($hook_data as $hook)
                                                {
                                                    if(is_string($hook) || is_int($hook))
                                                    {
                                                        echo htmlspecialchars_decode($hook);
                                                    }
                                                }
                                            }
                                        {{/php}}
                                    </div>
                                {{/foreach}}
                            {{/if}}
                        </div>

                        <!-- 首页楼层内部底部钩子 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                            <div class="plugins-tag">
                                <span>plugins_view_home_floor_inside_bottom</span>
                            </div>
                        {{/if}}
                        {{php}}
                            $hook_name = 'plugins_view_home_floor_inside_bottom';
                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                            if(!empty($hook_data) && is_array($hook_data))
                            {
                                foreach($hook_data as $hook)
                                {
                                    if(is_string($hook) || is_int($hook))
                                    {
                                        echo htmlspecialchars_decode($hook);
                                    }
                                }
                            }
                        {{/php}}
                    </div>
                </div>

                <!-- 首页楼层底部钩子 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_home_floor_bottom_{{$key+1}}</span>
                    </div>
                {{/if}}
                {{php}}
                    $hook_name = 'plugins_view_home_floor_bottom_'.($key+1);
                    $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                    if(!empty($hook_data) && is_array($hook_data))
                    {
                        foreach($hook_data as $hook)
                        {
                            if(is_string($hook) || is_int($hook))
                            {
                                echo htmlspecialchars_decode($hook);
                            }
                        }
                    }
                {{/php}}
            {{/foreach}}
        {{/if}}
    </div>
{{/if}}

<!-- 楼层数据底部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    <div class="plugins-tag">
        <span>plugins_view_home_floor_bottom</span>
    </div>
{{/if}}
{{if !empty($plugins_view_home_floor_bottom_data) and is_array($plugins_view_home_floor_bottom_data)}}
    {{foreach $plugins_view_home_floor_bottom_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
        {{/if}}
    {{/foreach}}
{{/if}}

{{include file="public/footer" /}}

{{if isset($is_design) and $is_design eq 1}}
    <!-- layout formback -->
    {{include file="../../../layout/view/form_back" /}}
{{/if}}